package middleware

import (
	"token-centre/global"

	"github.com/gin-gonic/gin"
)

func Login(c *gin.Context) {
	var auth = c.GetHeader("authorization")
	if auth != ("Bearer " + global.Config.Auth) {
		c.JSON(401, gin.H{
			"message": "auth 验证失败！",
		})
		c.Abort()
	}
	c.Next()
}
